package com.Login.dao;

import com.Pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * Created by XingYang on 2019/3/1.
 */
//@Repository
//public class UserDao extends BaseDao {
//    @Autowired
//    JdbcTemplate jdbcTemplate;
//
//    public Map<String,Object> getUser(String username){
//        Map<String ,String> map = new HashMap<>();
//        map.put("username",username);
//        String sql ="select * from user where user_name='"+username+"'";
//
//
//        return jdbcTemplate.queryForMap(sql);
//
//
//    }
//
//    public List getAllUser(){
//
//        return  jdbcTemplate.queryForList("select * from user",new User());
//
//    }
//
//}
@Repository
@Mapper
public interface LoignDao {

    public List<User> getAllUser();

    public User getUserById(String uid);

    public User getUserByUsername(String username);

    public List<String> getRolesByUid(String uid);
    /**
     * 从role表中获取角色数据
     */

    public List<Map> getRolesInfByUid(String uid);

    public List<String> getPowersByUid(String uid);

    public List<String> getPowersByRid(String rid);

    public Map getRoleInfByRid(String rid);

    public List<Map> getAllPowers();

    public List<Map<String,String>> getPermissionConfig();

    public void addUser(User user);

    public int addRole(Map map);

    public int modifyRole(Map map);

    public void roleBindPower(Map map );

    public int roleUnBindPower(String rid);

    public int delRoleByRId(String Rid);

    public int disableRoleByRId(String Rid);

    public int enableRoleByRId(String Rid);

    public List<Map> queryManagerByMainId(String mainaccount);



}
